import request from '@/utils/request'

export const reqCateList = () => request({
  url: '/cate/catelist',
  method: 'post'
})

export const reqAddOrUpdateCate = (cate) => {
  // 如果有id，那么就是修改
  if (cate.id) {
    return request({ url: '/cate/update', method: 'post', data: cate })
  } else {
    // 没有id，那就是新增
    return request({ url: '/cate/save', method: 'post', data: cate })
  }
}

// 删除品牌
export const reqRemoveCate = (id) => request({
  url: `/cate/remove/${id}`,
  method: 'get'
})
